<% @main_header = "#{link_to('Ptrack:', '/')} New User" %>

<% @title = "Create A New User" %>

<%= error_messages_for 'user' %>

<% form_for @user, :url => {:action => 'create'} do |f| %>
  <table>
    <tr>
      <td><%= f.label 'username', 'Username:' %></td>
      <td><%= f.text_field 'login', :size => 20 %></td>
    </tr>
    <tr>
      <td><%= f.label 'password', 'Password:' %></td>
      <td><%= f.password_field 'password', :size => 20 %></td>
    </tr>
    <tr>
      <td><%= f.label 'password', 'Password (again):' %></td>
      <td><%= f.password_field 'password_confirmation', :size => 20 %></td>
    </tr>
    <tr>
      <td><%= f.label 'name', 'Name:' %></td>
      <td><%= f.text_field 'name', :size => '20x20' %></td>
    </tr>
    <tr>
      <td><%= f.label 'surname', 'Surname:' %></td>
      <td><%= f.text_field 'surname', :size => '20x20' %></td>
    </tr>
    <tr>
      <td><%= f.label :email, 'E-mail Address:' %></td>
      <td><%= f.text_field :email%></td>
    </tr>
    <% if current_user.is_admin? %>
      <tr>
        <td><%= f.label 'hourly_rate', 'Hourly Rate:' %></td>
        <td><%= f.text_field 'hourly_rate', :size => 6 %> TL/hrs</td>
      </tr>
      <% if current_user.id!=@user.id %>
        <tr>
          
          <td><%= f.label 'admin', 'Has Administrative Rights?' %></td
          <br>
<td><%= f.check_box 'is_admin', {} ,1,0 %></td>
        </tr>
      <%  end %>
    <% end %>
    <tr>
      <td><%= f.label 'keywords', 'Keywords:' %></td>
      <td><%= f.text_field 'keywords', :size => 20 %></td>
    </tr>
    <tr>
      <td></td><td><%= submit_tag 'Create' %> </td>
    </tr>
  </table>
<% end %>


